package com.ygqh.baby.controller;

import com.wdt.api.exception.WdtException;
import com.wdt.api.response.StockQueryResponse;
import com.ygqh.baby.ao.Message;
import com.ygqh.baby.service.WdtQybStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.sql.Date;

@Controller
@RequestMapping("/wdt")
public class WdtController {

    @Autowired
    private WdtQybStockService wdtQybStockService;

    @RequestMapping("stockQuery")
    @ResponseBody
    public Message stockQuery(Date startDate, Date endDate, String... warehouseNo) throws WdtException {
        StockQueryResponse stockQueryResponse = wdtQybStockService.stockQuery(startDate, endDate, warehouseNo);
        return Message.success(stockQueryResponse);
    }
}
